import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase="DBshop005_订单管理查询"
# 1.点击销售管理订单管理界面。
firefox=openBrowser("http://localhost/dbshop/admin")
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,"销售管理","订单管理")
# 2.在订单号查询框输入orderNumber，点击“搜索”按钮。
rootpath=get_pro_rootpath()
with open(rootpath+'\public\order3.txt',"r",encoding="utf-8") as f1:
    flist=f1.readlines()
orderNumber=flist[0]
firefox.find_element_by_xpath("(//input[@name='order_sn'])[1]").send_keys(orderNumber)
firefox.find_element_by_xpath("(//button[@class='btn btn-small btn-primary'])[1]").click()
# 断言
try:
    if firefox.find_element_by_xpath("//body/div[2]/div/div[2]/table/tbody/tr[2]/td[2]").is_displayed():
        writeLog("%s 测试通过"%testCase)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()
